package com.punai.customer.mapper;

import com.punai.common.core.mapper.CommonMapper;
import com.punai.customer.domain.CusGxFee;
import com.punai.customer.domain.bo.FeeLinkFeatureAndCategoryResultBo;
import com.punai.customer.domain.vo.CusAllVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工序分包费用项Mapper接口
 *
 * @author zxw
 * @date 2022-12-09
 */
public interface CusGxFeeMapper extends CommonMapper<CusGxFee>
{
    public FeeLinkFeatureAndCategoryResultBo selectDmcGxFeeById(@Param("id") String id, @Param("companyId") Long companyId);

    /**
     * 查询工序分包费用项列表
     *
     * @param dmcGxFee 工序分包费用项
     * @return 工序分包费用项集合
     */
    public List<CusGxFee> selectDmcGxFeeList(@Param("fee") CusGxFee dmcGxFee, @Param("chapterIds") List<String> chapterIds, @Param("companyId") Long companyId);


    /**
     * 删除工序分包费用项
     *
     * @param id 工序分包费用项主键
     * @return 结果
     */
    public int deleteDmcGxFeeById(String id);

    /**
     * 批量删除工序分包费用项
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDmcGxFeeByIds(String[] ids);

    public int updateChapterId(@Param("chapterIds")List<String> chapterIds,@Param("companyId") Long companyId,@Param("notClassifiedId") String notClassifiedId);

    int countNotAllot(@Param("companyId") Long companyId,@Param("specId") String specId,@Param("notClassifiedId") String notClassifiedId);

    Integer countByChapterId(@Param("companyId") Long companyId,@Param("specId") String specId);

    /**
     * 标准费用项重新编码
     * @param companyId
     */
    void recodeGx(@Param("companyId") Long companyId,@Param("specId") String specId,@Param("prefix") String prefix,@Param("suffixLen") Integer suffixLen);

    public List<CusGxFee> queryContrast(@Param("companyId")Long companyId, @Param("ids") String[] ids);

    String ifExistFee(@Param("companyId")Long companyId,@Param("specId") String specId);

    public List<CusAllVo> countFee(@Param("companyId")Long companyId);

    int updateChapterIdByIds(@Param("ids") String[] ids, @Param("chapterId") String chapterId,@Param("companyId")Long companyId);

    List<String> selectWithFbgc(@Param("companyId")Long companyId,@Param("id") String id);
}
